﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Data
{
    public class UsersManager : DBManager
    {
        public UsersManager()
        {
            TableName = "[users]";
        }

        public bool CheckLogin(String login, String passwd)
        {
            SqlCommand command = Connection.CreateCommand();
            command.CommandText = "SELECT [login], [passwd] FROM " + TableName + 
                " WHERE [login] = '" + login + "' AND [passwd] = '" + passwd + "'";
            using (SqlDataReader reader = command.ExecuteReader())
            {
                if (reader.HasRows)
                    return true;
                else 
                    return false;    
            }
        }
    }
}
